/* eslint-disable */
/**
 * Created by GYL on 2018/8/24
 */
import React, { Component } from 'react';
import styles from '../EventPosting.less';
import { Collapse, Icon, Select, Input, Tooltip, Form, Row, Col, TreeSelect, DatePicker, message } from 'antd';
import PublicService from "../../../services/PublicService";
import config from '../../../config';
import Util from '../../../utils/Util';
import request from '../../../utils/request';
import MyTable from "../../../components/common/MyTable";
import MyModal from '../../../components/common/MyModal';
import moment from 'moment';
const { Panel } = Collapse;
const { Option } = Select;
const { TextArea } = Input;
const FormItem = Form.Item;
const { SHOW_CHILD } = TreeSelect;

class Edit extends Component {

    constructor(props) {
        super(props)

    }

    componentDidMount() {

        this.setState({
            MyModal1Visible: true
        })

        // console.log('  MyModal1Visible:true')

        //获取文件结构
        this.getFileSiteTreeTwo()


        // console.log(this.props.EditData)
        let sonArrListTwo = [

            {
                type: 'select',
                paramName: 'milepost',
                id: 'milepost',
                key: "milepost",
                label: '是否为里程碑',
                rules: [{ ...config.reg.required }],
                span: 12,
                placeholder: '请选择',
                stylesCol: { display: this.props.EditData.hierarchy == 1 ? '' : 'none' },
                options: [

                    { text: '否', value: 0 },
                    { text: '是', value: 1 },

                ],
                initialValue: this.props.EditData.milepost,
                disabled: false
            },
            {
                type: 'TextArea',
                paramName: 'subeventsName',
                id: 'subeventsName',
                title: '最多显示30个字',
                num: 30,
                key: "subeventsName",
                label: '子事件名称',
                style: { width: 650 },
                rules: [{ ...config.reg.required }],
                span: 24,
                rows: 1,
                colSpan: 24,
                initialValue: this.props.EditData.subeventsName,
                disabled: true

            },
            {
                type: 'TextArea',
                paramName: 'subeventsDescribe',
                id: 'subeventsDescribe',
                title: '最多显示200个字',
                num: 200,
                key: "subeventsDescribe",
                label: '子事件说明',
                style: { width: 650 },
                rules: [{ ...config.reg.required }],
                span: 24,
                rows: 2,
                colSpan: 24,
                initialValue: this.props.EditData.subeventsDescribe,
                disabled: true
            },
            {
                type: 'TextArea',
                paramName: 'safetyInformation',
                id: 'safetyInformation',
                title: '最多显示200个字',
                num: 200,
                key: "safetyInformation",
                label: '安全防护措施',
                style: { width: 650 },

                span: 24,
                rows: 2,
                colSpan: 24,
                initialValue: this.props.EditData.safetyInformation,
                disabled: true
            },

            {
                type: 'TextArea',
                paramName: 'subeventsWeight',
                id: 'subeventsWeight',
                key: "subeventsWeight",
                label: '子事件权重',
                rules: this.props.EditData.hierarchy == 1 ? [{ ...config.reg.long3 }] : null,
                style: { width: 170 },
                stylesCol: { display: this.props.EditData.hierarchy == 1 ? '' : 'none' },
                span: 8,
                // title: '0/4',
                title: `${this.props.EditData.subeventsWeight.length}/4`,
                num: 4,
                rows: 1,
                colSpan: 24,
                initialValue: this.props.EditData.subeventsWeight,
            }, {
                type: 'datePicker',
                label: '计划开始时间',
                paramName: 'planStartTime',
                initialValue: this.props.EditData.planStartTime ? moment(this.props.EditData.planStartTime) : "",
                rules: [{ ...config.reg.required }],
                style: { width: 170 },
                rules: [{ ...config.reg.required }],
                span: 8,
                rows: 1,
                colSpan: 24,
            },
            {
                type: 'datePicker',
                label: '计划结束时间',
                paramName: 'planEndTime',
                initialValue: this.props.EditData.planEndTime ? moment(this.props.EditData.planEndTime) : "",
                rules: [{ ...config.reg.required }],
                style: { width: 170 },
                rules: [{ ...config.reg.required }],
                span: 8,
                rows: 1,
                colSpan: 24,
            },
            {
                type: 'TextArea',
                paramName: 'workTime',
                id: 'workTime',
                title: '只能填写数字',
                num: 30,
                key: "workTime",
                label: '计划工期',
                style: { width: 170, height: 20 },
                rules: [{ ...config.reg.long }],
                span: 8,
                rows: 1,
                colSpan: 24,
                initialValue: this.props.EditData.workTime,
                disabled: true,
            },
            {
                type: 'TextArea',
                paramName: 'responsibleDepartmentName',
                id: 'responsibleDepartmentName',
                title: '最多显示200个字',
                num: 200,
                key: "responsibleDepartmentName",
                label: '子责任部门',

                treeCheckable: true,
                span: 8,
                rows: 1,
                colSpan: 24,
                style: { width: 170 },
                // treeData: this.props.EditData.confirmUserTree,
                disabled: true,
                initialValue: this.props.EditData.responsibleDepartmentName

            },

            {
                type: 'select',
                paramName: 'sureWay',
                id: 'sureWay',
                key: "sureWay",
                label: '子确认方式',
                rules: [{ ...config.reg.required }],
                style: { width: 170 },
                rules: [{ ...config.reg.required }],
                span: 8,
                rows: 1,
                colSpan: 24,
                placeholder: '请选择',
                options: [
                    { text: '用户勾选', value: 1 },
                    { text: '上传文档', value: 2 },

                ],
                disabled: true,
                initialValue: this.props.EditData.sureWay
            },
            {
                type: 'select',
                paramName: 'auditWay',
                id: 'auditWay',
                key: "auditWay",
                label: '子审核方式',
                rules: [{ ...config.reg.required }],
                style: { width: 170 },
                rules: [{ ...config.reg.required }],
                span: 8,
                rows: 1,
                colSpan: 24,
                placeholder: '请选择',
                options: [
                    { text: '不需审核', value: 1 },
                    { text: '系统内审核', value: 2 },
                    { text: '系统内抄送', value: 3 },
                    { text: 'OA审批', value: 4 },

                ],
                disabled: true,
                initialValue: this.props.EditData.auditWay
            },
            {
                type: 'treeSelect',
                paramName: 'confirmUserId',
                id: 'confirmUserId',
                title: '最多显示200个字',
                num: 200,
                key: "confirmUserId",
                label: '子确认用户',
                rules: [{ ...config.reg.required }],
                // treeCheckable: false,
                span: 24,
                rows: 1,
                colSpan: 24,
                style: { width: 650 },
                treeData: this.props.EditData.confirmUserTree,
                initialValue: this.props.EditData.confirmUserId

            },
            {
                type: 'treeSelect',
                paramName: 'safetyInformationUser',
                id: 'safetyInformationUser',
                title: '最多显示200个字',
                num: 200,
                key: "safetyInformationUser",
                label: '安全提示人',
                treeCheckable: true,
                maxTagCount: 5,
                rules: [{ ...config.reg.required }],
                // treeCheckable: false,
                span: 24,
                rows: 1,
                colSpan: 24,
                style: { width: 650 },
                treeData: this.props.EditData.userTree,
                initialValue: this.props.EditData.safetyInformationUser

            },
            {
                type: 'TextArea',
                paramName: 'assDepRoles',
                id: 'assDepRoles',
                title: '最多显示200个字',
                num: 30,
                key: "assDepRoles",
                label: '子协助部门',

                span: 24,
                rows: 2,
                colSpan: 24,
                style: { width: 650 },
                initialValue: this.props.EditData.assDepRoles,
                disabled: true,

            },
            {
                type: 'TextArea',
                paramName: 'outcomeDocument',
                id: 'outcomeDocument',
                title: '最多显示200个字',
                num: 30,
                key: "outcomeDocument",
                label: '成 果 文 件 ',

                span: 24,
                rows: 2,
                colSpan: 24,
                style: { width: 650 },
                initialValue: this.props.EditData.outcomeDocument,
                disabled: true,

            }

        ]


        //说明用户选择上传文档,则会有三种不同的情况看下
        if (this.props.EditData.auditWay == 2) {
            //说明为系统内审核

            sonArrListTwo.push(
                {
                    type: 'treeSelect',
                    paramName: 'auditUsers',
                    id: 'auditUsers',
                    title: '最多显示200个字',
                    num: 200,
                    key: "auditUsers",
                    label: '子审核用户',
                    rules: [{ ...config.reg.required }],
                    treeCheckable: true,
                    span: 24,
                    rows: 1,
                    colSpan: 24,
                    style: { width: 650 },
                    treeData: this.props.EditData.auditUserTree,
                    initialValue: this.props.EditData.auditUsers

                },
                {
                    type: 'treeSelect',
                    paramName: 'auditCcUsers',
                    id: 'auditCcUsers',
                    title: '最多显示200个字',
                    num: 200,
                    key: "auditCcUsers",
                    label: '子抄送用户',
                    // rules: [{ ...config.reg.required }],
                    treeCheckable: true,
                    span: 24,
                    rows: 1,
                    colSpan: 24,
                    style: { width: 650 },
                    treeData: this.props.EditData.auditCcUserTree,
                    initialValue: this.props.EditData.auditCcUsers

                },
            )

        } else if (this.props.EditData.auditWay == 3) {
            //系统内抄送
            sonArrListTwo.push(
                {
                    type: 'treeSelect',
                    paramName: 'auditCcUsers',
                    id: 'auditCcUsers',
                    title: '最多显示200个字',
                    num: 200,
                    key: "auditCcUsers",
                    label: '子抄送用户',
                    rules: [{ ...config.reg.required }],
                    treeCheckable: true,
                    span: 24,
                    rows: 1,
                    colSpan: 24,
                    style: { width: 650 },
                    treeData: this.props.EditData.auditCcUserTree,
                    initialValue: this.props.EditData.auditCcUsers

                },
            )
        }else if(this.props.EditData.auditWay == 4){
            sonArrListTwo.push(
                {
                    type: 'treeSelect',
                    paramName: 'oaUserArr',
                    id: 'oaUserArr',
                    title: '最多显示200个字',
                    num: 200,
                    key: "oaUserArr",
                    label: 'OA人员',
                    treeCheckable: true,
                    maxTagCount: 5,
                    rules: [{ ...config.reg.required }],
                    // treeCheckable: false,
                    span: 24,
                    rows: 1,
                    colSpan: 24,
                    style: { width: 650 },
                    treeData: this.props.EditData.oaUserTree,
                    initialValue: this.props.EditData.oaUserArr
    
                },
            )
        }


        this.setState({
            arr: sonArrListTwo
        })


    }

    getFileSiteTreeTwo = () => {
        request({
            url: '/pm-web/projectmanage/filesite/getFileSiteTreeTwo',
            method: 'POST',
            data: {}
        }).then(data => {
            if (data.rc === 0) {
                this.setState({
                    TreeSelecttreeData: data.ret.tmList
                })
            }
        })
    }

    state = {
        Task: [],
        MyModal1Visible: true,
        flagAll: this.props.EditData.status == 1 && this.props.EditData.isRemind == 1 ? true : this.props.EditData.status == 2 &&this.props.EditData.isRemind == 1 ? true :false,
        treeArr: [],//一般下拉
        treeArr: [],
        selectedRowKeys: [],
        arr: [

            {
                type: 'select',
                paramName: 'milepost',
                id: 'milepost',
                key: "milepost",
                label: '是否为里程碑',
                rules: [{ ...config.reg.required }],
                span: 12,
                placeholder: '请选择',
                stylesCol: { display: this.props.EditData.hierarchy == 1 ? '' : 'none' },
                options: [

                    { text: '否', value: 0 },
                    { text: '是', value: 1 },

                ],
                initialValue: this.props.EditData.milepost,
                disabled: false
            },
            {
                type: 'TextArea',
                paramName: 'subeventsName',
                id: 'subeventsName',
                title: '最多显示30个字',
                num: 30,
                key: "subeventsName",
                label: '子事件名称',
                style: { width: 650 },
                rules: [{ ...config.reg.required }],
                span: 24,
                rows: 1,
                colSpan: 24,
                initialValue: this.props.EditData.subeventsName,
                disabled: true

            },
            {
                type: 'TextArea',
                paramName: 'subeventsDescribe',
                id: 'subeventsDescribe',
                title: '最多显示200个字',
                num: 200,
                key: "subeventsDescribe",
                label: '子事件说明',
                style: { width: 650 },
                rules: [{ ...config.reg.required }],
                span: 24,
                rows: 2,
                colSpan: 24,
                initialValue: this.props.EditData.subeventsDescribe,
                disabled: true
            },
            {
                type: 'TextArea',
                paramName: 'safetyInformation',
                id: 'safetyInformation',
                title: '最多显示200个字',
                num: 200,
                key: "safetyInformation",
                label: '安全防护措施',
                style: { width: 635 },

                span: 24,
                rows: 2,
                colSpan: 24,
                initialValue: this.props.EditData.safetyInformation,
                disabled: true
            },
            {
                type: 'TextArea',
                paramName: 'subeventsWeight',
                id: 'subeventsWeight',
                key: "subeventsWeight",
                label: '子事件权重',
                rules: this.props.EditData.hierarchy == 1 ? [{ ...config.reg.long3 }] : null,
                style: { width: 170 },
                stylesCol: { display: this.props.EditData.hierarchy == 1 ? '' : 'none' },
                span: 8,
                // title: '0/4',
                title: `${this.props.EditData.subeventsWeight.length}/4`,
                num: 4,
                rows: 1,
                colSpan: 24,
                initialValue: this.props.EditData.subeventsWeight,
            }, {
                type: 'datePicker',
                label: '计划开始时间',
                paramName: 'planStartTime',
                initialValue: this.props.EditData.planStartTime ? moment(this.props.EditData.planStartTime) : "",
                rules: [{ ...config.reg.required }],
                style: { width: 170 },
                rules: [{ ...config.reg.required }],
                span: 8,
                rows: 1,
                colSpan: 24,
            },
            {
                type: 'datePicker',
                label: '计划结束时间',
                paramName: 'planEndTime',
                initialValue: this.props.EditData.planEndTime ? moment(this.props.EditData.planEndTime) : "",
                rules: [{ ...config.reg.required }],
                style: { width: 170 },

                span: 8,
                rows: 1,
                colSpan: 24,
            },
            {
                type: 'TextArea',
                paramName: 'workTime',
                id: 'workTime',
                title: '只能填写数字',
                num: 30,
                key: "workTime",
                label: '计划工期',
                style: { width: 170, height: 20 },
                rules: [{ ...config.reg.long }],
                span: 8,
                rows: 1,
                colSpan: 24,
                initialValue: this.props.EditData.workTime,
                disabled: true,
            },
            {
                type: 'TextArea',
                paramName: 'responsibleDepartmentName',
                id: 'responsibleDepartmentName',
                title: '最多显示200个字',
                num: 200,
                key: "responsibleDepartmentName",
                label: '子责任部门',

                treeCheckable: true,
                span: 8,
                rows: 1,
                colSpan: 24,
                style: { width: 170 },
                // treeData: this.props.EditData.confirmUserTree,
                disabled: true,
                initialValue: this.props.EditData.responsibleDepartmentName

            },

            {
                type: 'select',
                paramName: 'sureWay',
                id: 'sureWay',
                key: "sureWay",
                label: '子确认方式',
                rules: [{ ...config.reg.required }],
                style: { width: 170 },
                rules: [{ ...config.reg.required }],
                span: 8,
                rows: 1,
                colSpan: 24,
                placeholder: '请选择',
                options: [
                    { text: '用户勾选', value: 1 },
                    { text: '上传文档', value: 2 },

                ],
                disabled: true,
                initialValue: this.props.EditData.sureWay
            },
            {
                type: 'select',
                paramName: 'auditWay',
                id: 'auditWay',
                key: "auditWay",
                label: '子审核方式',
                rules: [{ ...config.reg.required }],
                style: { width: 170 },
                rules: [{ ...config.reg.required }],
                span: 8,
                rows: 1,
                colSpan: 24,
                placeholder: '请选择',
                options: [
                    { text: '不需审核', value: 1 },
                    { text: '系统内审核', value: 2 },
                    { text: '系统内抄送', value: 3 },
                    { text: 'OA审批', value: 4 },

                ],
                disabled: true,
                initialValue: this.props.EditData.auditWay
            },
            {
                type: 'treeSelect',
                paramName: 'confirmUserId',
                id: 'confirmUserId',
                title: '最多显示200个字',
                num: 200,
                key: "confirmUserId",
                label: '子确认用户',
                rules: [{ ...config.reg.required }],
                // treeCheckable: false,
                span: 24,
                rows: 1,
                colSpan: 24,
                style: { width: 650 },
                treeData: this.props.EditData.confirmUserTree,
                initialValue: this.props.EditData.confirmUserId

            },
            {
                type: 'treeSelect',
                paramName: 'safetyInformationUser',
                id: 'safetyInformationUser',
                title: '最多显示200个字',
                num: 200,
                key: "safetyInformationUser",
                label: '安全提示人',
                treeCheckable: true,
                maxTagCount: 5,
                rules: [{ ...config.reg.required }],
                // treeCheckable: false,
                span: 24,
                rows: 1,
                colSpan: 24,
                style: { width: 650 },
                treeData: this.props.EditData.userTree,
                initialValue: this.props.EditData.safetyInformationUser

            },
            {
                type: 'TextArea',
                paramName: 'assDepRoles',
                id: 'assDepRoles',
                title: '最多显示200个字',
                num: 30,
                key: "assDepRoles",
                label: '子协助部门',

                span: 24,
                rows: 2,
                colSpan: 24,
                style: { width: 650 },
                initialValue: this.props.EditData.assDepRoles,
                disabled: true,

            },
            {
                type: 'TextArea',
                paramName: 'outcomeDocument',
                id: 'outcomeDocument',
                title: '最多显示200个字',
                num: 30,
                key: "outcomeDocument",
                label: '成 果 文 件 ',

                span: 24,
                rows: 2,
                colSpan: 24,
                style: { width: 650 },
                initialValue: this.props.EditData.outcomeDocument,
                disabled: true,

            },
        ],
        roleIdArr: [],
        expandIconPosition: 'left',
        title: '添加子事件',
        subEvent: false,
        subEventArr: [],
        sonArrList: []

    };

    onDelete = () => {
        // console.log('删除')
    }
    //计算文本域内数字个数
    onChangeNum = (v) => {
        var strs = getByteLen(v);
        function getByteLen(val) {
            strs = val.replace(/[\ |\~|\`|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\_|\+|\=|\||\\|\[|\]|\{|\}|\;|\:|\"|\'|\,|\<|\.|\>|\/|\?|\，|\。|\？|\：|\；|\‘|\’|\”|\“|\、|\·|\！|\（|\）|\》|\《|\『|\』]/g, "");
            return strs;
        }
        return strs.length

    }
    // 取消保存
    // ModalCancel = (type) => {
    //     let t = this;
    //     t.setState({
    //         [type]: false,
    //         modalBtnLoading: false
    //     })
    //     this.props.ModalCancel()
    // };



    // 筛选条件组件change事件
    getChangeValue = (value, e) => {
        let t = this;
        let params = {};
        params[value] = e.target.value;
        t.setState({ params });
        //form表单赋值-----改变文本域数字个数
        this.props.form.setFieldsValue({ [value]: e.target.value })
        this.addChange(value, e.target.value.length)


    }



    getChangeValueList = (value, e) => {
        let t = this;
        let params = {};
        params[value] = e.target.value;
        t.setState({ params });
        //form表单赋值-----改变文本域数字个数
        this.props.form.setFieldsValue({ [value]: e.target.value })
        this.addChangeList(value, e.target.value.length)


    }

    addChangeList = (v, num) => {
        this.state.arr[10].list.forEach(item => {
            if (item.paramName === v) {
                item.title = `${num}/${item.num}`
            }
        });
    }


    //新增改变tooplie的显示文字
    addChange = (v, num) => {
        this.state.arr.forEach(item => {
            if (item.paramName === v) {
                item.title = `${num}/${item.num}`
            }
        });
    }

    //保存按钮事件
    onModalSave = () => {

        this.props.form.validateFields((errors, values) => {
            // console.log(errors, values)
            if (!errors) {
                this.props.onModalSave(values)
            }

        });

    }


    selectedChange(fun, nextParams, paramName, index, value) {
        // console.log(fun, nextParams, paramName, index, value)


        let t = this;
        let params = {};
        params[paramName] = value;
        if (paramName) {
            t.setState({ params }, () => {
            });
        }
        if (typeof fun === "function") {
            fun(value);
            if (nextParams)
                t.props.form.setFieldsValue({
                    [nextParams]: ''
                })
        }
    }


    //多选
    onSelectChange = (selectedRowKeys, row) => {
        // console.log(selectedRowKeys, row)
        this.setState({ selectedRowKeys, row })
    };

    onDatePicker = (paramName, v, str) => {
        console.log(paramName, v, str)
        setTimeout(() => {
            // console.log(this.props.form.getFieldValue('planStartTime'))

            if (this.props.form.getFieldValue('planEndTime') && this.props.form.getFieldValue('planStartTime')) {
                let num = this.props.form.getFieldValue('planEndTime').diff(this.props.form.getFieldValue('planStartTime'), 'days')
                console.log(num)
                if (this.props.form.getFieldValue('planStartTime').isBefore(this.props.form.getFieldValue('planEndTime'))) {

                } else {
                    message.warning('结束时间不可以小于开始时间!')
                    this.props.form.setFieldsValue({ 'planEndTime': null })
                    return
                }
                if (num > 0) {
                    num = num + 1
                }
                if (num == 0) {
                    num = 1
                }
                if (num < 0) {
                    message.warning('结束时间不可以小于开始时间!')
                    return
                } else {
                    this.props.form.setFieldsValue({ 'workTime': num })
                }
            }

        }, 500);


    }



    render() {
        let t = this
        let width = document.body.clientWidth;
        const height = document.body.clientHeight;
        let containerHeight = '76vh';
        let tableHeight = 310;
        if (width > 1367) {
            tableHeight = 380;
            containerHeight = '83vh';
        }
        const { expandIconPosition, selectedRowKeys } = this.state;
        let { getFieldDecorator } = this.props.form;
        const genExtra = () => (

            <span onClick={this.onDelete} style={{ color: 'red' }}>删除</span>
        );

        const columns = [
            {
                title: '序号',
                dataIndex: 'num',
                width: '5%',
                align: "center",
            },
            {
                title: '文件名',
                dataIndex: 'fileName',
                width: '20%',
                align: "center",
            },
            {
                title: "文件所属结构",
                dataIndex: 'fileType',
                width: '25%',
                align: "center",
                render: (text, record, index) => {
                    return <TreeSelect
                        className={styles.TreeSelect}
                        // treeCheckable={true}
                        // disabled={!this.props.footerShow}
                        // className={item.shuoming}
                        disabled={true}
                        maxTagCount={5}
                        // style={item.style}
                        treeData={this.state.TreeSelecttreeData}
                        // onChange={this.TreeSelectselectedChange.bind(this, record, index)}
                        value={record.fileSiteId}
                        showCheckedStrategy={SHOW_CHILD}
                        searchPlaceholder={'请选择文件位置'}
                    // disabled={item.disabled}
                    />

                }
            },

            {
                title: '上传时间',
                width: '20%',
                dataIndex: 'createTime',
                align: "center",
            },
            {
                title: '上传人',
                width: '15%',
                dataIndex: 'uploadUser',
                align: "center",
            },

        ]

        let rowSelection = {
            selectedRowKeys,
            onChange: this.onSelectChange.bind(this),
        };


        return (

            <MyModal
                mask={false}
                width={800}
                {...this.props}
                title={'事件信息补充'}
                footerShow={this.state.flagAll}
                // destroyOnClose={true}
                // onCancel={this.ModalCancel.bind(this, 'MyModal1Visible')}
                onModalSave={this.onModalSave}
            >

                <Form layout={'inline'} style={{ paddingLeft: 40, paddingRight: 40 }} >
                    <Row gutter={48} key={55555}>
                        {
                            this.state.arr.map((item, index) => {
                                if (item.type === 'TextArea') {
                                    return (
                                        <Col span={item.span || 8} key={index} className={item.className} style={item.stylesCol}>
                                            <Form.Item label={item.label} key={item.paramName}>
                                                <Tooltip
                                                    trigger={['focus']}
                                                    title={item.title}
                                                    placement="topLeft"
                                                    overlayClassName="numeric-input"
                                                >
                                                    {
                                                        getFieldDecorator(item.paramName, {
                                                            initialValue: item.initialValue ? item.initialValue : '',
                                                            rules: item.rules || null
                                                        })(

                                                            <TextArea
                                                                style={item.style}
                                                                placeholder={item.placeholder}
                                                                // onChange={this.onChange}
                                                                className={item.shuoming}
                                                                rows={item.rows}
                                                                maxLength={item.num}
                                                                disabled={item.disabled} id={[item.paramName]}
                                                                onChange={this.getChangeValue.bind(this, item.paramName)} size={config.size}
                                                            />

                                                        )
                                                    }
                                                </Tooltip>
                                            </Form.Item>
                                        </Col>
                                    )
                                } else if (item.type === 'select') {
                                    return (
                                        <Col span={8} key={index} style={item.stylesCol}>
                                            <Form.Item label={item.label} key={item.paramName} className={item.className} >
                                                {
                                                    getFieldDecorator(item.paramName, {
                                                        initialValue: item.initialValue ? item.initialValue : (item.options[0] ? Util.numToString(item.options[0].value) : item.options[0]),
                                                        rules: item.stylesCol ? null : item.rules || null
                                                    })(
                                                        <Select
                                                            size={config.size}
                                                            showSearch
                                                            style={item.style}
                                                            mode={item.mode}
                                                            placeholder="Select a person"
                                                            className={item.shuoming}
                                                            optionFilterProp="children"
                                                            dropdownMatchSelectWidth={t.props.dropdownMatchSelectWidth}
                                                            onChange={t.selectedChange.bind(t, item.selectChange, item.nextParamName || false, item.paramName)}
                                                            onSelect={item.onSelect}
                                                            disabled={item.disabled}
                                                        >
                                                            {
                                                                item.options.map(option => {
                                                                    return (
                                                                        <Select.Option key={option.value}
                                                                            value={Util.numToString(option.value)}
                                                                        >
                                                                            {option.text}
                                                                        </Select.Option>

                                                                    )
                                                                })
                                                            }
                                                        </Select>
                                                    )
                                                }
                                            </Form.Item>
                                        </Col>
                                    )
                                } else if (item.type === 'treeSelect') {
                                    return (
                                        <Col span={item.span || 8} key={index}>
                                            <Form.Item label={item.label} key={item.paramName} className={item.className} >
                                                {
                                                    getFieldDecorator(item.paramName, {
                                                        initialValue: item.initialValue ? item.initialValue : null,
                                                        rules: item.rules || null
                                                    })(
                                                        <TreeSelect
                                                            treeData={item.treeData}
                                                            onChange={t.selectedChange.bind(t, item.selectChange, item.nextParamName || false, item.paramName)}
                                                            treeCheckable={item.treeCheckable}
                                                            showCheckedStrategy={SHOW_CHILD}
                                                            // searchPlaceholder={'请选部门'}
                                                            style={item.style}
                                                            maxTagCount={item.maxTagCount}
                                                        />
                                                    )
                                                }
                                            </Form.Item>
                                        </Col>
                                    )
                                } else if (item.type === 'datePicker') {
                                    let disabled = item.disabledDate ? disabledDate : null;
                                    return (
                                        <Col span={item.span || 8} key={index}>
                                            <Form.Item label={item.label} key={item.paramName} className={item.className} >
                                                {
                                                    getFieldDecorator(item.paramName, {
                                                        initialValue: item.initialValue ? item.initialValue : null,
                                                        rules: item.rules || null
                                                    })(
                                                        <DatePicker size={config.size} disabledDate={disabled} disabled={item.disabled} onChange={this.onDatePicker.bind(this, item.paramName)} />
                                                    )
                                                }
                                            </Form.Item>
                                        </Col>
                                    )
                                } else if (item.type === 'title') {
                                    return (


                                        <Col span={item.span || 8} key={index} style={{ paddingLeft: 0, paddingRight: 0, height: item.height }}>
                                            {/* <div style={{ width: "100%", borderBottom: "5px solid #423578",marginBottom:10 }}></div> */}
                                            <h2 style={{ fontSize: 14, fontWeight: 700, position: 'relative', marginBottom: 0, marginTop: item.marginTop, marginBottom: 5 }}><span style={{ padding: 1, color: "#fff", backgroundColor: item.backgroundColor, position: 'absolute', left: '-15px', width: 5, height: 20 }}> </span><span style={{ color: item.color }}>{item.name}</span></h2>


                                        </Col>


                                    )
                                } else if (item.type === 'arr') {
                                    return (
                                        item.list.map((item, index) => {
                                            if (item.type === 'TextArea') {
                                                return (
                                                    <Col span={item.span || 8} key={index}>
                                                        <Form.Item label={item.label} key={item.paramName} className={item.className} >
                                                            <Tooltip
                                                                trigger={['focus']}
                                                                title={item.title}
                                                                placement="topLeft"
                                                                overlayClassName="numeric-input"
                                                            >
                                                                {
                                                                    getFieldDecorator(item.paramName, {
                                                                        initialValue: item.initialValue ? item.initialValue : '',
                                                                        rules: item.rules || null
                                                                    })(

                                                                        <TextArea
                                                                            style={item.style}
                                                                            placeholder={item.placeholder}
                                                                            className={item.shuoming}
                                                                            // onChange={this.onChange}
                                                                            rows={item.rows}
                                                                            maxLength={item.num}
                                                                            disabled={item.disabled} id={[item.paramName]}
                                                                            onChange={this.getChangeValueList.bind(this, item.paramName)} size={config.size} style={item.style}
                                                                        />

                                                                    )
                                                                }
                                                            </Tooltip>
                                                        </Form.Item>
                                                    </Col>
                                                )
                                            } else if (item.type === 'delete') {
                                                return (
                                                    <Col span={22} key={index} xxl={{ push: 2 }} style={{ textAlign: 'right', height: 20 }} push={2}>
                                                        <IconFont type="icon-dongjie" onClick={this.onDelete.bind(this, item.index)} style={{ fontSize: 16, cursor: 'pointer', width: 20, height: 20, color: 'red' }} />
                                                        <IconFont type="icon-quanxianpeizhi" onClick={this.onHuifu.bind(this, item.index)} style={{ fontSize: 16, cursor: 'pointer', width: 20, height: 20, color: 'green' }} />
                                                        {/* <button onClick={this.onDelete.bind(this, item.index)}>删除</button> */}
                                                    </Col>
                                                )
                                            }

                                        })


                                    )
                                } else if (item.type === 'button') {
                                    return (
                                        <Col span={2} key={index} xxl={{ pull: 0 }} style={{ textAlign: 'right', height: 20, width: 2 }} pull={1}>

                                            <IconFont type="icon-xinzeng" onClick={this.addListfx} style={{ fontSize: 16, cursor: 'pointer', width: 20, height: 20, color: '#16B8BD' }} />
                                        </Col>
                                    )
                                }

                            })
                        }

                    </Row>
                </Form>
                <div style={{ width: '100%', height: 'auto', padding: '0px 40px', display: this.props.EditData.sureWay == 2 ? '' : 'none' }}>
                    <MyTable
                        pagination={false}
                        columns={columns}
                        dataSource={this.props.EditData.fileList}
                    />
                </div>


            </MyModal>
        );


    }
}
export default Form.create()(Edit);

